package com.lzh.chatnote.chat.domain.dto.message;

import com.lzh.chatnote.chat.domain.enums.PushTypeEnum;
import com.lzh.chatnote.webSocket.domain.vo.resp.WSBaseResp;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Collections;
import java.util.List;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class PushMsgDTO {

    @ApiModelProperty(value = "推送用户列表")
    private List<Long> pushUids;

    @ApiModelProperty(value = "推送类型 0 群推送 1全员推送 PushTypeEnum类型")
    private Integer pushType;

    @ApiModelProperty(value = "推送内容")
    private WSBaseResp<?> wsBaseResp;

    public PushMsgDTO(List<Long> pushUids,  WSBaseResp<?> wsBaseResp) {
        this.pushUids = pushUids;
        this.pushType = PushTypeEnum.GROUP.getType();
        this.wsBaseResp = wsBaseResp;
    }

    public PushMsgDTO(Long uid,  WSBaseResp<?> wsBaseResp) {
        this.pushUids = Collections.singletonList(uid);
        this.pushType = PushTypeEnum.GROUP.getType();
        this.wsBaseResp = wsBaseResp;
    }

    public PushMsgDTO(WSBaseResp<?> wsBaseResp) {
        this.pushType = PushTypeEnum.ALL.getType();
        this.wsBaseResp = wsBaseResp;
    }

}
